import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/home/Home.vue'),
    redirect:'/home/shop', // 设置默认打开的子路由页面
    children:[
      {
        path: '/home/mycar',
        name: 'mycar',
        component: () => import('../views/ insurance/mycar/mycar'),
      },
      {
        path: '/home/mygoods',
        name: 'mygoods',
        component: () => import('../views/ insurance/jifengoods/mygoods'),
      },
      {
        path: '/home/jifengoods',
        name: 'jifengoods',
        component: () => import('../views/ insurance/jifengoods/jifengoods'),
      },
      {
        path: '/home/shenqing',
        name: 'shenqing',
        component: () => import('../views/ insurance/lipei/shenqing'),
      },
      {
        path: '/home/guanlianlipei',
        name: 'guanlianlipei',
        component: () => import('../views/ insurance/baodan/guanlianlipei'),
      },
      {
        path: '/home/mybaodan',
        name: 'mybaodan',
        component: () => import('../views/ insurance/baodan/mybaodan'),
      },
      {
        path: '/home/mybaodan2',
        name: 'mybaodan2',
        component: () => import('../views/ insurance/baodan/mybaodan2'),
      },
      {
        path: '/home/shop',
        name: 'Shop',
        component: () => import('../views/ insurance/index'),
      },
	  {
	    path: '/home/pay/:pid/:type',
	    name: 'Pay',
	    component: () => import('../views/ insurance/pay'),
	  },
      {
        path: '/home/car',
        name: 'Car',
        component: () => import('../views/ insurance/car/car'),
      },
	  {
	    path: '/home/carinsurance',
	    name: 'Car',
	    component: () => import('../views/ insurance/car/carinsurance'),
	  },
      {
        path: '/home/accident',
        name: 'Accident',
        component: () => import('../views/ insurance/accident/accident'),
      },
	  {
	    path: '/home/accidentinsurance',
	    name: 'accidentinsurance',
	    component: () => import('../views/ insurance/accident/accidentinsurance'),
	  },
	  {
        path: '/home/service',
        name: 'Service',
        component: () => import('../views/ insurance/service'),
      },
      {
        path: '/home/baodansearch',
        name: 'baodansearch',
        component: () => import('../views/ insurance/baodansearch/baodansearch'),
      },{
        path: '/home/lipeisearch',
        name: 'lipeisearch',
        component: () => import('../views/ insurance/lipeisearch/lipeisearch'),
      },{
        path: '/home/personal',
        name: 'info',
        component: () => import('../views/ insurance/personal/info'),
      },{
        path: '/home/consult',
        name: 'consult',
        component: () => import('../views/ insurance/consult/consult')
      },{
        path: '/home/file',
        name: 'file',
        component: () => import('../views/ insurance/file/file')
      },{
        path: '/home/message',
        name: 'message',
        component: () => import('../views/ insurance/message/message')
      }

    ]
  },
  {
    path: '/',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/Register.vue')
  },
  {
    path: '/password',
    name: 'password',
    component: () => import('../views/password')
  }
]

const router = new VueRouter({
  routes
})

export default router
